﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IEProvider.cs" company="">
//   
// </copyright>
// <summary>
//   The ie provider.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace UITest.Selenium.WebDrivers
{
    using OpenQA.Selenium;
    using OpenQA.Selenium.IE;
    using OpenQA.Selenium.Remote;

    /// <summary>
    ///     The ie provider.
    /// </summary>
    public class IEProvider : IRemoteWebDriverProvider
    {
        #region Public Methods and Operators

        /// <summary>
        ///     The new driver.
        /// </summary>
        /// <returns>
        ///     The <see cref="IWebDriver" />.
        /// </returns>
        public RemoteWebDriver NewDriver()
        {
            // NOTE: Protected Mode must be set to the same value (enabled or disabled) for all zones.
            // GoTo Internet Options. Click Security Tab. Check or Uncheck "Enable Protected Mode" for all Internet, Local Intranet, Trusted Sites and Restricted Sites.
            var driver = new InternetExplorerDriver();
            driver.Manage().Window.Maximize();
            driver.Manage().Cookies.DeleteAllCookies();
            return driver;
        }

        #endregion
    }
}